<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        img {
            position: absolute;

        }
    </style>
</head>

<body>
    <img src="img/angel.gif" alt="">
    <script>
        var pic = document.querySelector('img')
        document.addEventListener('mousemove', function (e) {
            // mousemove只要我们鼠标移动1px 就会触发事件
            // console.log(1);

            var x = e.pageX;
            var y = e.pageY;
            pic.style.left = x + 'px';
            pic.style.top = y + 'px';
        })
    </script>

</body>

</html>